<template>
  <el-card class="box-card">
    <!-- 面包屑导航 -->
    <div slot="header"
         class="clearfix">
      <bread :navone="'权限管理'"
             :navtwo="'权限列表'" />
    </div>
    <!-- 权限表格 -->
    <el-table :data="tableData"
              style="width: 100%"
              :border='true'>
      <el-table-column type="index">
      </el-table-column>
      <el-table-column prop="authName"
                       label="权限名称"
                       width="180">
      </el-table-column>
      <el-table-column prop="path"
                       label="路径"
                       width="180">
      </el-table-column>
      <el-table-column label="层级">
        <template slot-scope="scope">
          {{scope.row.level == 0? '第一层级':scope.row.level == 1 ? '第二层级':'第三层级'}}
        </template>
      </el-table-column>
    </el-table>
  </el-card>
</template>

<script>
import bread from '../bread/bread.vue'
export default {
  components: {
    bread
  },
  created () {
    this.getrights()
  },
  data () {
    return {
      tableData: []
    }
  },
  methods: {
    async getrights () {
      let res = await this.$http.get('rights/list')
      let { meta, data } = res.data
      if (meta.status === 200) {
        this.tableData = data
      }
    }
  }
}
</script>

<style>
</style>
